<!---
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->
<div class="container content apps">
      <div class="toparea"><div class="pattern-wrapper"></div></div>
      <form>
        <div class="input-group input-group-lg">
          <div class="input-group-addon">
            <span class="glyphicon glyphicon-search" id="search"></span>
          </div>
          <input type="text" class="form-control" placeholder="Search for applications from HDFS" aria-describedby="search" ng-model="searchText" ng-change="change(text)" />
        </div>
      </form>

      <p></p>
      <p class="recommended">Recommended</p>

      <div ng-repeat="a in appStore" ng-if="$index % 3 == 0" class="row">
        <div ng-repeat="i in [$index, $index + 1, $index + 2]"
             ng-if="appStore[i] != null" class="col-xs-4 col-md-4 col-lg-4 apps">
          <div class="tile mdl-shadow-4dp">
            <img ng-src="{{appStore[i].icon}}" alt="" width="128" height="128" ng-if="appStore[i] != null" />
            <div class="card-title">
              <h3>{{appStore[i].org}}</h3>
              <h2>{{appStore[i].name}}</h2>
            </div>
            <div class="card-desc">
              <p>{{appStore[i].desc}}</p>
            </div>
          </div>
          <div class="card-footer mdl-shadow-4dp">
            <div class="pull-left">
              <!-- <span class="glyphicon glyphicon-thumbs-up"></span> {{appStore[i].like | counterValue}} -->
              <span class="glyphicon glyphicon-cloud-download"></span> {{appStore[i].download | counterValue}}
            </div>
            <div class="pull-right">
              <button class="btn btn-secondary" ng-click="deployApp(appStore[i].id)">DEPLOY</button>
            </div>
          </div>
        </div>
      </div>
</div>
